home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DJGPP / LGP250S1.ZIP / src / libgplus.5 / libgplus / proto-ki / prepend < prev    next >
Text File  |  1991-06-28  |  360b  |  30 lines

  1. #!/bin/csh
  2.  
  3. # usage: prepend file string1 ... stringn 
  4. #
  5.  
  6. if ($#argv < 2) then 
  7. echo incorrect usage ; exit 1;
  8. endif
  9.  
  10. set FILE = $1; shift;
  11. set TMP = /tmp/prepend.$$
  12.  
  13. if (!(-r $FILE)) then
  14. echo file $FILE not found ; exit 1;
  15. endif
  16.  
  17. set DUMMY = 0
  18.  
  19. while ($DUMMY < $#argv)
  20. @ DUMMY++
  21. echo $argv[$DUMMY] >>& $TMP
  22. end
  23.  
  24. cat $FILE >> $TMP
  25.  
  26. cp $TMP $FILE
  27.  
  28. rm -f $TMP
  29.  
  30.